package com.yc.snacknet_vue.biz.Impl;

import java.util.Collections;
import java.util.List;

import com.yc.snacknet_vue.bean.AddrInfo;
import com.yc.snacknet_vue.biz.IAddrrInfoBiz;
import com.yc.snacknet_vue.dao.IAddrInfoDAO;
import com.yc.snacknet_vue.dao.impl.AddrInfoDAOImpl;
import com.yc.snacknet_vue.utils.StringUtil;

public class AddrInfoBizImpl implements IAddrrInfoBiz {

	@Override
	public int add(AddrInfo addr) {
		if (StringUtil.checkNull(addr.getAno(), addr.getName(), addr.getTel(), addr.getCity(),addr.getProvince())) {
			return -1;
		}
		IAddrInfoDAO dao = new AddrInfoDAOImpl();
		return dao.add(addr);
	}

	@Override
	public List<AddrInfo> findByMno(Integer mno) {
		if( mno == null) {
			return Collections.emptyList();
		}
		IAddrInfoDAO dao = new AddrInfoDAOImpl();
		return dao.findByMno(mno);
	}

}
